package server.workwithmaster;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import abstractservlet.AbstractServlet;
import autoservice.api.controller.IAutoservice;
import controllers.Autoservice;

@WebServlet("/GetMasterByOrder")
public class GetMasterByOrder extends AbstractServlet {
	private static final String GET_MASTER_BY_ORDER_PAGE = "/workwithmasterpages/GetMasterByOrderPage.jsp";
	private static final String NUMBER_ORDER = "numberOrder";
	private static final long serialVersionUID = 1L;
	private static final String GET_MASTER_BY_ORDER_OPERAT = "get master by order";
	private IAutoservice autoservice = Autoservice.getInstance();

	public GetMasterByOrder() {
		super();

	}

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		String parameters = request.getParameter(NUMBER_ORDER);
		super.navigate(request, response, GET_MASTER_BY_ORDER_OPERAT,
				autoservice.getMasterByOrder(parameters).get(0),
				GET_MASTER_BY_ORDER_PAGE);

	}

}
